package Test;

import Interact.Interactable;
import Tool.Binaryable;

/**
 * 一个虚类，只保存了大多数题干所需要的内容
 * @author prairial
 *
 */
abstract public class QuestionBody implements Binaryable, Interactable{
	/** 题干编号 */
	private int id;
	/** 所属科目 */
	private Course course;	
	/** 题目满分 */
	private int grade;
	/** 出题人ID */
	private int teacherID;
	/** 插图 */
	private Illustration illustration;
	
	public QuestionBody(){
		this(0, null, 0, 0);
	}
	public QuestionBody(int id, Course course, int grade, int teacherID){
		this.id = id;
		this.course = course;
		this.grade = grade;
		this.teacherID = teacherID;
		illustration = new Illustration();
	}
	
	/**
	 * 获取题型
	 */
	abstract public int getType();
	
	@Override
	public String getKey() {
		return "body" + id;
	}
	
	@Override
	public void setMode(int mode) {	
	}
	
	/** getters and setters */
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}

	public int getGrade() {
		return grade;
	}

	public void setGrade(int grade) {
		this.grade = grade;
	}

	public int getTeacherID() {
		return teacherID;
	}

	public void setTeacherID(int teacherID) {
		this.teacherID = teacherID;
	}

	public Illustration getIllustration() {
		return illustration;
	}

	public void setIllustration(Illustration illustration) {
		this.illustration = illustration;
	}
}












